﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $configs['websiteName'] . '——用户注册' ?></title>
</head>

<body>

<div class="container center">
	<div id="article">
		<div id="title">用户注册</div>
		<br />
		<form action="<?php echo url('users', 'register') ?>" method="post" enctype="multipart/form-data" name="registerForm" id="registerForm">
			<div class="title">1、设置您的账户名</div>
			<hr class="ds">
			<div class="subForm">
				<div class="item">
					<div class="subTitle">用户名：</div>
					<div class="inputBox"><?php echo $form['username'] ?></div>
					<div id="usernameTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">密码：</div>
					<div class="inputBox"><?php echo $form['password'] ?></div>
					<div id="pwdTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">确认密码：</div>
					<div class="inputBox"><?php echo $form['confirmPassword'] ?></div>
					<div id="confirmPwdTip"></div>
				</div>			
			</div>			
			<div class="title">2、设置您的基本资料</div>
			<hr class="ds">
			<div class="subForm">
				<div class="item">
					<div class="subTitle">真实姓名：</div>
					<div class="inputBox"><?php echo $form['trueName'] ?></div>
					<div id="trueNameTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">学号：</div>
					<div class="inputBox"><?php echo $form['stuNum'] ?></div>
					<div id="stuNumTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">政治面貌：</div>
					<div class="inputBox"><?php echo $form['politics'] ?></div>
					<div id="trueNameTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">性别：</div>
					<div class="inputBox"><?php echo $form['sex'] ?></div>
				</div>
				<div class="item">
					<div class="subTitle">籍贯：</div>
					<div class="inputBox"><?php echo $form['province'] ?></div>
				</div>
				<div class="item">
					<div class="subTitle">是否持有绿卡：</div>
					<div class="inputBox"><?php echo $form['poor'] ?></div>
					<div id="poor_4Tip"></div>
				</div>
				<div class="item">
					<div class="subTitle">层次：</div>
					<div class="inputBox"><?php echo $form['userType'] ?></div>
				</div>
				<div class="item">
					<div class="subTitle">学院：</div>
					<div class="inputBox"><?php echo $form['college'] ?></div>
					<div id="collegeTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">系：</div>
					<div class="inputBox"><?php echo $form['department'] ?></div>
					<div id="departmentTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">专业：</div>
					<div class="inputBox"><?php echo $form['major'] ?></div>
				</div>
				<div class="item">
					<div class="subTitle">宿舍地址：</div>
					<div class="inputBox"><?php echo $form['room'] ?></div>
				</div>
				<div class="item">
					<div class="subTitle">广州工商银行卡号：</div>
					<div class="inputBox"><?php echo $form['bankCardNum'] ?></div>
					<div id="bankCardNumTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">联系电话：</div>
					<div class="inputBox"><?php echo $form['tel'] ?></div>
					<div id="telTip"></div>
				</div>
				<div class="item">
					<div class="subTitle">电子邮箱：</div>
					<div class="inputBox"><?php echo $form['email'] ?></div>
					<div id="emailTip"></div>
				</div>
			</div>
			<div class="title">3、设置密码保护</div>
			<hr class="ds">
			<div class="subForm">
				<div class="item">
					<div class="subTitle">密码保护提示：</div>
					<div class="inputBox"><?php //echo $form['question'] ?></div>
					<div id="questionTip">* </div>
				</div>
				<div class="item">
					<div class="subTitle">密码保护答案：</div>
					<div class="inputBox"><?php //echo $form['answer'] ?></div>
					<div id="answerTip"></div>
				</div>

			</div>
			<div style="margin:10px auto">
				<input type="submit" id="s" class="botton" value="注 册" />
				<input type="reset" class="botton" value="重 置" />
			</div>
		</form>
	</div>
</div>

<script type="text/javascript">
var maj=new Array();
<?php
//构造js形式的数组
$i=0;
foreach ($majors as $k => $v){
	foreach ($v as $kk => $vv){
		foreach ($vv as $kkk => $vvv){
			echo "maj[$i]=new Array();";
			echo "maj[$i][0]='$k';";
			echo "maj[$i][1]='$kk';";
			echo "maj[$i][2]='$vvv';";
			$i++;
		}
	}
}
?>
//初始化“学院”选项
	var college = document.getElementById('college');
	var count=maj.length;
	var k=1;
	for(var j=0;j<count;j++){
		if(k==1 || maj[j-1][0]!= maj[j][0]){
			college.options[k]=new Option(maj[j][0],maj[j][0]);
			k++;
		}	
	}
//根据“学院”的值构造“系”的范围
function selectDepartment(){
	var college = document.getElementById('college');
	var department = document.getElementById('department');
	var major = document.getElementById('major');
	var count=maj.length;
	department.length=1;
	major.length=1;
	var k=1;
	for(var j=0;j<count;j++){
		if(maj[j][0] == college.value && (k==1 || maj[j-1][1]!= maj[j][1] )){
			department.options[k]=new Option(maj[j][1],maj[j][1]);
			k++;
		}	
	}
}
//根据“学院”和“系”的值构造“专业”的范围
function selectMajor(){
	var college = document.getElementById('college');
	var department = document.getElementById('department');
	var major = document.getElementById('major');
	var count=maj.length;
	major.length=1;
	var k=1;
	for(var j=0;j<count;j++){
		if(maj[j][0]==college.value && maj[j][1]==department.value ){
			major.options[k]=new Option(maj[j][2],maj[j][2]);
			k++;
		}	
	}
}

</script>
</body>
</html>